package com.API.dal.entities;

// Generated 03.06.2013 4:15:36 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Equipments generated by hbm2java
 */
@Entity
@Table(name = "EQUIPMENTS", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = @UniqueConstraint(columnNames = "NAME"))
public class Equipments implements java.io.Serializable {

	private Integer id;
	private EquipmentsTypes equipmentsTypes;
	private Units units;
	private String name;
	private String fullName;
	private String status;
	private String description;
	private Set<EquipmentCosts> equipmentCostses = new HashSet<EquipmentCosts>(
			0);
	private Set<EquipmentsProjects> equipmentsProjectses = new HashSet<EquipmentsProjects>(
			0);
	private Set<OrdersEquipments> ordersEquipmentses = new HashSet<OrdersEquipments>(
			0);

	public Equipments() {
	}

	public Equipments(EquipmentsTypes equipmentsTypes, Units units,
			String name, String status) {
		this.equipmentsTypes = equipmentsTypes;
		this.units = units;
		this.name = name;
		this.status = status;
	}

	public Equipments(EquipmentsTypes equipmentsTypes, Units units,
			String name, String fullName, String status, String description,
			Set<EquipmentCosts> equipmentCostses,
			Set<EquipmentsProjects> equipmentsProjectses,
			Set<OrdersEquipments> ordersEquipmentses) {
		this.equipmentsTypes = equipmentsTypes;
		this.units = units;
		this.name = name;
		this.fullName = fullName;
		this.status = status;
		this.description = description;
		this.equipmentCostses = equipmentCostses;
		this.equipmentsProjectses = equipmentsProjectses;
		this.ordersEquipmentses = ordersEquipmentses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TYPE_ID", nullable = false)
	public EquipmentsTypes getEquipmentsTypes() {
		return this.equipmentsTypes;
	}

	public void setEquipmentsTypes(EquipmentsTypes equipmentsTypes) {
		this.equipmentsTypes = equipmentsTypes;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UNIT_ID", nullable = false)
	public Units getUnits() {
		return this.units;
	}

	public void setUnits(Units units) {
		this.units = units;
	}

	@Column(name = "NAME", unique = true, nullable = false, length = 64)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "FULL_NAME", length = 128)
	public String getFullName() {
		return this.fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	@Column(name = "STATUS", nullable = false, length = 64)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "DESCRIPTION", length = 512)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "equipments")
	public Set<EquipmentCosts> getEquipmentCostses() {
		return this.equipmentCostses;
	}

	public void setEquipmentCostses(Set<EquipmentCosts> equipmentCostses) {
		this.equipmentCostses = equipmentCostses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "equipments")
	public Set<EquipmentsProjects> getEquipmentsProjectses() {
		return this.equipmentsProjectses;
	}

	public void setEquipmentsProjectses(
			Set<EquipmentsProjects> equipmentsProjectses) {
		this.equipmentsProjectses = equipmentsProjectses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "equipments")
	public Set<OrdersEquipments> getOrdersEquipmentses() {
		return this.ordersEquipmentses;
	}

	public void setOrdersEquipmentses(Set<OrdersEquipments> ordersEquipmentses) {
		this.ordersEquipmentses = ordersEquipmentses;
	}

}
